<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><![endif]-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    <%@include file="../include/csslib.jsp"%>
	<link href="${pageContext.request.contextPath}/static/web_css/db/db.css" rel="stylesheet" type="text/css">

	<style type="text/css">
		.normal {color: Green}
		.error {color: Red}
	</style>
</head>

<body>

<div class="wrapper dashboard">

    <!-- 右侧 -->
    <div class="main">

        <!-- 内容区 -->
        <div class="content_container container-fluid">
            <div class="row">
                <!-- pane1 -->
                <div class="col-sm-12">
                    <div class="pane">
                      <!-- <h2><span>渠道列表</span></h2> -->

                        <div class="pane_condition">

                        </div>

                        <div class="pane_content">
                        <div class="form-group">
						    <label class="col-sm-3 control-label no-padding-right" for="form-field-1">选择游戏项目</label>
							    <div class="col-sm-9">
									<c:if test="${not empty games}">
  											<select name="select_game" id="select_game" style="width:200px;">
										     <c:forEach items="${games}" var="item">
										     	<c:if test="${item.gameId == gameId}">
										     		<option value="${item.gameId}" selected="selected">${item.nameCn}</option>
										     	</c:if>
										     	<c:if test="${item.gameId != gameId}">
										     		<option value="${item.gameId}">${item.nameCn}</option>
										     	</c:if>
										     </c:forEach>
						        		</select>
									</c:if>
							    </div>
							</div>

                            <table style="margin: 0;padding: 0;">
								<tr style="height: 25px;">
								<td>监控中央服备份总数：${total}</td>
								<td>&nbsp&nbsp<font color="LawnGreen">正常：${correct}</font></td>
								<td>&nbsp&nbsp<font color="Blue">新装中央服或没有提交脚本脚本提交失败：${newGameserver}</font></td>
								<td>&nbsp&nbsp<font color="Gold">远程备份文件出错：${warning}</font></td>
								<td>&nbsp&nbsp<font color="Red">没有远程备份文件：${critical}</font></td>
								</tr>
							</table>
							
							<table class="layui-table" lay-size="sm">
								<thead>
									<tr>
										<th>中央服IP</th>
										<th>备份地域</th>
										<th>备份文件名</th>
										<th>备份文件md5码</th>
										<th>备份文件大小</th>
										<th>备份时间</th>
										<th>备份状态</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								<c:forEach items="${poList}" var="item">
									<tr bgcolor=${item.color} align="middle">
										<td rowspan="2">${item.ip}</td>
										<td>${item.items[0].area}</td>
  										<td>${item.items[0].bakFileName}</td>
										<td>${item.items[0].bakFileMd5}</td>
										<td>${item.items[0].bakFileSize}</td>
										<td>${item.items[0].bakTime}</td>
										
										<c:choose>
											<c:when test="${item.items[0].state == 'successful'}"> 
												<td><div id="state${item.ip}" class="normal">成功</div></td>
											</c:when>
											
											<c:otherwise>
												<td><div id="state${item.ip}" class="error">出错</div></td>
											</c:otherwise>
										</c:choose>
										
										<td>
											<a href="javascript:manualInfocenterDbBak('${item.ip}');">本地备份</a>
											<br>
											<a href="javascript:manualInfocenterDbBakRemote('${item.ip}');">远程备份</a>
										</td>
									</tr>
									
									<tr bgcolor=${item.color} align="middle">
										<td>${item.items[1].area}</td>
  										<td>${item.items[1].bakFileName}</td>
										<td>${item.items[1].bakFileMd5}</td>
										<td>${item.items[1].bakFileSize}</td>
										<td>${item.items[1].bakTime}</td>
									</tr>
									
								</c:forEach>
								</tbody>
							</table>
                        </div>

                    </div>
                </div>
            </div>

        </div>
        <!-- 内容区结束 -->

    </div>
    <!-- 右侧  结束-->

</div>


<%@include file="../include/jslib.jsp"%>
<script src="${pageContext.request.contextPath}/static/web_js/db/bakInfocenter.js"></script>
</body>
</html>